// 获取下一道题目
import {useGet, usePost} from "@/utils/request";
import type {API} from "@/type/type";

export const getNextQuestionAPI = async (licenseType: string, subject: string) => {
  return useGet<API.INextQuestion>("/question/getNextQuestion", {licenseType, subject})
}

export const getErrorQuestionAPI = async (licenseType: string, subject: string) => {
  return useGet<API.INextQuestion>("/question/getNextErrorQuestion", {licenseType, subject})
}
export const getNextQuestionByTypeAPI = async (typeId: string) => {
  return useGet<API.INextQuestion>("/question/getNextQuestionByType", {typeId})
}

export const addAnswerRecordAPI = async (data: API.IAnswerRecord) => {
  return usePost<API.IAnswerRecord>("/answerRecord", data)
}

export const addAnswerSessionAPI = async (data: API.IAnswerSession) => {
  return usePost<API.IAnswerSession>("/answerSesson", data)
}

export const getCurrentAnswerRecordAPI = async (licenseType: string, subject: string) => {
  return useGet<API.INextQuestion>("/question/getCurrentAnswerRecord", {licenseType, subject})
}
export const getAiNextQuestionAPI = async () => {
  return useGet<API.INextQuestion>("/question/getNextAiQuestion", {})
}

export const listQuestionTypeAPI = async () => {
  return useGet<API.IQuestionType[]>("/questionType/list", {})
}
